package com.threeti.mecool.core.domain.model.plan.aspects;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.threeti.mecool.core.domain.model.plan.pojo.Step;
import com.threeti.mecool.core.infrastructure.persistence.plan.StepRepository;

privileged aspect Step_AJ_Domain {
	@Autowired
	@JsonIgnore
	private transient StepRepository Step.stepRepository;
	
	static StepRepository Step.stepRepository() {
		return new Step().stepRepository;
	}
	
	public static Step Step.findById(Long id) {
		return Step.stepRepository().findOne(id);
	}

	@Transactional
	public void Step.save() {
		stepRepository.save(this);
	}
}
